<!DOCTYPE html
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:py="http://genshi.edgewall.org/"
      xmlns:xi="http://www.w3.org/2001/XInclude">
  <xi:include href="layout.html" />
  <xi:include href="testmanagement.html" />
  <head>
    <title>Custom Fields</title>
  </head>

  <body>
    <div id="content" class="customfield">
      <h1>${customfield.id and 'Edit' or 'Create New'} Custom Field</h1>

      <form method="POST">

      <div>
        <div id="modify">
          <!-- Properties -->
          <fieldset id="properties" py:if="'TEST_EDIT' in perm">
            <legend>${customfield.id and 'Change ' or ''}Properties</legend>
            <table>
              <tr>
                <th><label for="field-name">Name:</label></th>
                <td class="fullrow">
                  <input type="text" id="field-name" name="name" size="20"
                         value="$customfield.name" />
                </td>
              </tr>
              <tr>
                <th><label for="field-label">Label:</label></th>
                <td class="fullrow">
                  <input type="text" id="field-label" name="label" size="20"
                         value="$customfield.label" />
                </td>
              </tr>
              <tr>
                <th><label for="field-field_type">Type:</label></th>
                <td class="fullrow">
                  <select id="field-field_type" name="field_type">
                    <py:for each="n, field_type_text in field_types">
                    <option value="$n" selected="${customfield.field_type == n and 'selected' or None}">$field_type_text</option>
                    </py:for>
                  </select>
                </td>
              </tr>
              <tr>
                <th><label for="field-possible_values">Possible Values:</label></th>
                <td class="fullrow">
                  <input type="text" id="field-possible_values" name="possible_values"
                         size="48" value="$customfield.possible_values" />
                </td>
              </tr>
              <tr>
                <th><label for="field-default_value">Default Value:</label></th>
                <td class="fullrow">
                  <input type="text" id="field-default_value" name="default_value"
                         size="48" value="$customfield.default_value" />
                </td>
              </tr>
              <tr>
                <th>Target:</th>
                <td class="fullrow">
                  <input type="checkbox" id="field-enable_on_project"
                         name="enable_on_project" value="1"
                         checked="${customfield.enable_on_project and 'checked' or None}"
                         /><label for="field-enable_on_project">Project</label>
                  <input type="checkbox" id="field-enable_on_testsuite"
                         name="enable_on_testsuite" value="1"
                         checked="${customfield.enable_on_testsuite and 'checked' or None}"
                         /><label for="field-enable_on_testsuite">Test Suite</label>
                  <input type="checkbox" id="field-enable_on_testcase"
                         name="enable_on_testcase" value="1"
                         checked="${customfield.enable_on_testcase and 'checked' or None}"
                         /><label for="field-enable_on_testcase">Test Case</label>
                </td>
              </tr>
              <tr>
                <th><label for="field-description">Description:</label></th>
                <td class="fullrow">
                  <textarea id="field-description" name="description"
                            class="wikitext trac-resizable" rows="7" cols="68"
                            >${customfield.description}</textarea>
                </td>
              </tr>
            </table>

        </fieldset>

        <div class="buttons">
          <input type="submit" value="${customfield.id and 'Submit changes' or 'Create custom field'}" />
          <input type="submit" name="fmt" value="delete" py:if="customfield.id" />
        </div>

        </div>
      </div>

      <div id="help"><strong>Note:</strong> 
        See <a href="${href.wiki(TracTestManagement)}">TracTestManagement</a> for help on using and creating custom field.
      </div> 

      </form>

    </div>
  </body>
</html>

